home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Experimental BBS Explossion 3
/
Experimental BBS Explossion III.iso
/
c
/
cujoct93.zip
/
1110088C
< prev
next >
Wrap
Text File
|
1993-08-10
|
577b
|
29 lines
/* clock.c: IBM PC Clock tick functions */
#include <dos.h>
/* Pointer to the clock tick */
static volatile unsigned long far *tptr = MK_FP(0,0x46c);
static unsigned long start = 0L;
/* clock_reset: Resets the timer */
void clock_reset(void)
{
start = *tptr;
}
/* clock_wait: Waits a certain number of ticks */
void clock_wait(unsigned long n)
{
start = *tptr;
while ((*tptr - start) < n)
;
}
/* clock_elapsed: Returns the number of ticks since last reset */
unsigned long clock_elapsed(void)
{
return *tptr - start;
}